<?php
include_once("../../../common/module/checkA.php");
include_once("../../../../config.php");
include_once("../controller/detail-edit.php");
?>



<?
//用来判断当前系统属于什么板块
$detail=select_one_line_all_items($table_Prefix."renewal","nid = ".$_REQUEST['nid']."");

?>
 
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<?php include ROOT_PATH_.'/controller/common/module/head.php'; ?>
</head>

<body>

<div id="topbar"><?php include ROOT_PATH_.'/controller/common/module/topbar.php'; ?></div>

<div id="container" class="member">


        <div id="sidebar">
            <?php include ROOT_PATH_.'/controller/common/module/sidebar.php'; ?>
        </div>


<div id="content" class="layui-form">




<div class="detail-box">


<h1> 项目资料 </h1>

<form id="add-form" method="post" action="detail-edit-function.php?nav-itemed=renewal" enctype="multipart/form-data" class="layui-form">


<input type="hidden" name="nid" value="<? echo $detail['nid']?>">

    <fieldset class="layui-elem-field layui-field-title">
        <legend> 基本信息 </legend>
    </fieldset>



<div class="layui-form-item">
    <label class="layui-form-label">账号</label>
    <div class="layui-input-block">
        <input type="text" name="ai_name" required  lay-verify="required" placeholder="请输入项目名称" autocomplete="off" class="layui-input" value="<? echo $detail['name']?>">
    </div>
</div>


    <div class="layui-form-item">
        <label class="layui-form-label">访问</label>
        <div class="layui-input-block">
            <input type="text" name="ai_visit" required  lay-verify="required" placeholder="请输入可以访问到该资源的地址" autocomplete="off" class="layui-input" value="<? echo $detail['visit']?>">
        </div>
    </div>

 

    <div class="layui-form-item">
        <label class="layui-form-label">类型</label>
        <div class="layui-input-block">
            <? foreach ($tag_array as $k => $v){?>
                <input type="radio" name="ai_type"  value="<?echo $v?>"    title="<?echo $v?>"  <? if($detail['type']==$v)      {echo "checked";} ?>>
            <?;}?>
        </div>
    </div>

 
    <div class="layui-form-item">
        <label class="layui-form-label">运行于</label>
        <div class="layui-input-block">
            <? foreach ($tag_array_2 as $k => $v){?>
                <input type="radio" name="ai_location"  value="<?echo $v?>"    title="<?echo $v?>"  <? if($detail['location']==$v)      {echo "checked";} ?>>
            <?;}?>
        </div>
    </div>

    <div class="layui-form-item">
        <label class="layui-form-label">项目金额</label>
        <div class="layui-input-block">
            <input type="text" name="ai_sum"   autocomplete="off" class="layui-input"  value="<? echo $detail['sum']?>">
        </div>
    </div>


    <div class="layui-form-item">
        <label class="layui-form-label">成本支出</label>
        <div class="layui-input-block">
            <input type="text" name="ai_cost"   autocomplete="off" class="layui-input"  value="<? echo $detail['cost']?>">
        </div>
    </div>




                        <?
                        $unit_list=select_lines_all_items($table_Prefix."unit","nid desc","relation = '客户'","0");
                        $unit=select_one_line_all_items($table_Prefix."unit","nid = '".$detail['unit']."'");

                        ?>


                        <div class="layui-form-item">
                            <label class="layui-form-label">所属单位</label>
                            <div class="layui-input-block">
                                <select name="ai_unit" lay-search="" >
                                    <option value="<? echo $detail['unit']?>"><? echo $detail['unit']." : ".$unit['name']?></option>
                                    <option value="">无</option>
                                    <? for($i=0;$i<count($unit_list);$i++){ ?>
                                        <option value="<? echo $unit_list[$i]['nid'] ?>"><? echo $unit_list[$i]['nid'] ?> : <? echo $unit_list[$i]['name'] ?></option>
                                    <? } ?>
                                </select>
                            </div>
                        </div>









    <div class="layui-form-item">
        <label class="layui-form-label">开始日期</label>
        <div class="layui-input-block">
            <input type="text" name="ai_startdate" id="date" autocomplete="off" class="layui-input laydate-icon laydate_date"  value="<?echo $detail['startdate']?>"  >
        </div>
    </div>

    <div class="layui-form-item">
        <label class="layui-form-label">首次续费日期</label>
        <div class="layui-input-block">
            <input type="text" name="ai_frist_enddate" id="date" autocomplete="off" class="layui-input laydate-icon laydate_date"  value="<?echo $detail['frist_enddate']?>"  >
        </div>
    </div>


    <div class="layui-form-item">
        <label class="layui-form-label">下次续费日期</label>
        <div class="layui-input-block">
            <input type="text" name="ai_next_enddate" id="date" autocomplete="off" class="layui-input laydate-icon laydate_date"  value="<?echo $detail['next_enddate']?>"  >
        </div>
    </div>




    <div class="layui-form-item">
        <label class="layui-form-label">状态</label>
        <div class="layui-input-block" >
            <input type="radio" name="ai_status" value="完成" title="完成" <? if ($detail['status'] == "完成") {
                echo "checked";
            } ?>>
            <input type="radio" name="ai_status" value="进行中" title="进行中" <? if ($detail['status'] == "进行中") {
                echo "checked";
            } ?>>

            <input type="radio" name="ai_status" value="自然流失" title="自然流失" <? if ($detail['status'] == "自然流失") {
                echo "checked";
            } ?>>
            <input type="radio" name="ai_status" value="我方终止" title="我方终止" <? if ($detail['status'] == "我方终止") {
                echo "checked";
            } ?>>
            <input type="radio" name="ai_status" value="客户终止" title="客户终止" <? if ($detail['status'] == "客户终止") {
                echo "checked";
            } ?>>
            <input type="radio" name="ai_status" value="其他" title="其他" <? if ($detail['status'] == "其他") {
                echo "checked";
            } ?>>

        </div>

    </div>



    <div class="layui-form-item layui-form-text">
        <label class="layui-form-label">备注</label>
        <div class="layui-input-block">
            <textarea name="ai_remark" placeholder="备注" class="layui-textarea"><? echo $detail['remark']?></textarea>
        </div>
    </div>








    <?
    $employee_list=select_lines_all_items($table_Prefix."employee","nid desc","","0");
    $onduty=select_one_line_all_items($table_Prefix."employee","nid = '".$detail['onduty']."'");

    ?>

    <div class="layui-form-item">
        <label class="layui-form-label">跟进客服</label>
        <div class="layui-input-block">
            <select name="ai_onduty" >
                <option value="<? echo $detail['onduty']?>"><? echo $detail['onduty']." : ".$onduty['name']?></option>
                <option value="">无</option>
                <? for($i=0;$i<count($employee_list);$i++){ ?>
                    <option value="<? echo $employee_list[$i]['nid'] ?>"><? echo $employee_list[$i]['nid'] ?> : <? echo $employee_list[$i]['name'] ?></option>
                <? } ?>
            </select>
        </div>
    </div>








                        <div class="function">
                            <div class="layui-input-block">
                                <button class="layui-btn" lay-submit lay-filter="formMemberAdd" type="submit">立即提交</button>
                                <button type="reset" class="layui-btn layui-btn-primary">重置</button>
                            </div>
                        </div>
                    </form>


                    <input name="navitemed" type="hidden" value="<? echo $_REQUEST['nav-itemed'] ?>"/>
                    <input name="sys_part"  type="hidden" value="<? echo $system_part ?>"/>
                    <input name="nowpageid" type="hidden" value="<? echo $_REQUEST['nowpageid'] ?>"/>
                    <input name="sortby"    type="hidden" value="<? echo $_REQUEST['sortby'] ?>"/>
                    <input name="term_nid"  type="hidden" value="<? echo $_REQUEST['term_nid'] ?>"/>



</form>
 


 
 
        </div>

 
 
<!--content端點01-->

<br class="clearfloat"/>
</div>
<!--container端點01-->
</div>







<?php include ROOT_PATH_ . "/controller/common/module/footer.php"; ?>

</body>
</html>
